import { defineConfig } from 'vitepress'
import vueJsx from '@vitejs/plugin-vue-jsx'
import demo from './theme/demoPlugin'

const BASE = '/blogui-mobile-vue/'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'Blogui Mobile Vue',
  description: '基于 vue 的移动端 UI 框架',
  lang: 'zh-CN',
  head: [
    [
      'link',
      { rel: 'icon', type: 'image/png', href: `${BASE}blogui-utils.png` },
    ],
  ],
  themeConfig: {
    logo: {
      src: '/blogui-utils.png',
    },
    search: {
      provider: 'local',
      options: {
        translations: {
          button: {
            buttonText: '搜索文档',
            buttonAriaLabel: '搜索文档',
          },
          modal: {
            noResultsText: '没有找到相关结果',
            displayDetails: '展示详细列表',
            resetButtonTitle: '清除查询条件',
            footer: {
              selectText: '选择',
              navigateText: '切换',
              closeText: '关闭',
            },
          },
        },
      },
    },
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: '快速上手', link: '/guide' },
      { text: '组件', link: '/components/button' },
      {
        text: 'blog-utils 生态',
        items: [
          {
            text: 'Blogui Mobile',
            link: 'https://gitee.com/xiaomoguiya/blogui-mobile',
          },
          {
            text: 'blog-utils Utils',
            link: 'https://gitee.com/xiaomoguiya/blog-utils',
          },
        ],
      },
    ],

    sidebar: {
      guide: [{ text: '快速上手', items: [] }],
      components: [
        {
          text: '通用',
          items: [
            {
              text: 'Button 按钮',
              link: '/components/button',
            },
          ],
        },
        // {
        //   text: '布局',
        //   items: [
        //     {
        //       text: 'SubTitle 子标题',
        //       link: '/components/sub-title',
        //     },
        //   ],
        // },
        // {
        //   text: '数据录入',
        //   items: [
        //     {
        //       text: 'Checkbox 多选框',
        //       link: '/components/checkbox',
        //     },
        //     {
        //       text: 'DatePicker 日期选择器',
        //       link: '/components/date-picker',
        //     },
        //     {
        //       text: 'DatePickerView 日期选择器视图',
        //       link: '/components/date-picker-view',
        //     },
        //     {
        //       text: 'Input 输入框',
        //       link: '/components/input',
        //     },
        //     {
        //       text: 'InputSearch 搜索输入框',
        //       link: '/components/input-search',
        //     },
        //     {
        //       text: 'Picker 选择器',
        //       link: '/components/picker',
        //     },
        //   ],
        // },
        // {
        //   text: '数据展示',
        //   items: [
        //     {
        //       text: 'Empty 空状态',
        //       link: '/components/empty',
        //     },
        //     {
        //       text: 'Tabs 标签页',
        //       link: '/components/tabs',
        //     },
        //     {
        //       text: 'Table 表格',
        //       link: '/components/table',
        //     },
        //   ],
        // },
        // {
        //   text: '反馈',
        //   items: [
        //     {
        //       text: 'Curtain 幕帘',
        //       link: '/components/curtain',
        //     },
        //     {
        //       text: 'Drawer 抽屉',
        //       link: '/components/drawer',
        //     },
        //     {
        //       text: 'DropdownMenu 下拉菜单',
        //       link: '/components/dropdown-menu',
        //     },
        //     {
        //       text: 'Modal 模态框',
        //       link: '/components/modal',
        //     },
        //     {
        //       text: 'Popover 气泡弹出框',
        //       link: '/components/popover',
        //     },
        //     {
        //       text: 'Toast 轻提示',
        //       link: '/components/toast',
        //     },
        //   ],
        // },
      ],
    },

    sidebarMenuLabel: '菜单',
    returnToTopLabel: '返回顶部',
    darkModeSwitchLabel: '外观',

    socialLinks: [
      {
        icon: {
          svg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitLab</title><path d="m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"/></svg>',
        },
        link: 'https://gitee.com/xiaomoguiya/blogui-mobile-vue.git',
      },
    ],
    outline: {
      label: '此页面',
    },

    docFooter: {
      prev: '上一页',
      next: '下一页',
    },

    footer: {
      copyright: '© 2023 二水 和 朝阳永续大前端团队',
    },
  },
  srcExclude: ['**/README.md'],
  rewrites: {
    'docs/:path': ':path',
    'src/:path/index.md': 'components/:path.md',
  },
  cleanUrls: true,
  base: BASE,
  vite: {
    resolve: {
      alias: {},
    },
    plugins: [vueJsx(), demo()],
  },
})
